package cn.lyq.card.ui.launch

import cn.lyq.card.R
import cn.lyq.card.base.BaseActivity
import cn.lyq.card.global.Const
import cn.lyq.card.global.SPKeyGlobal
import cn.lyq.card.ui.login.LoginActivity
import cn.lyq.card.ui.login.LoginVM
import cn.lyq.card.ui.main.MainActivity
import com.blankj.utilcode.util.SPUtils


class LaunchActivity : BaseActivity() {

    override fun getLayoutId(): Int {
        return R.layout.act_launch
    }

    override fun initObserver() {
        super.initObserver()
        val token = SPUtils.getInstance().getString(SPKeyGlobal.BASE.TOKEN, "")
        if (token.isEmpty()) {
            startActivity(LoginActivity::class.java)
        } else {
            Const.token = token
            startActivity(MainActivity::class.java)
        }
    }
}